package dao.jpa;

import java.util.List;

import vo.Topic;
import dao.TopicDAO;

public class TopicDAOJpaImpl extends GenericDaoJpaImpl<Topic, Long> implements TopicDAO {

	public TopicDAOJpaImpl() {
		super(Topic.class);
	}

	public List<Topic> findAll() {
		return super.executeFinder("Topic.findAll");
	}

	public long findCount() {
		return super.executeFinderCount("Topic.findCount");
	}

	public long findCountByName(String name) {
		return super.executeFinderCount("Topic.findCountByName",name);
	}

	public long findCountByExpireDttm(String expireDttm) {
		return super.executeFinderCount("Topic.findCountByExpireDttm",expireDttm);
	}

	public long findCountByNameAndExpireDttm(String name, String expireDttm) {
		return super.executeFinderCount("Topic.findCountByNameExpireDttm", name, expireDttm);
	}

	public List<Topic> findAll(int start, int pageSize) {
		return super.executeFinderPage("Topic.findAll", start, pageSize);
	}

	public List<Topic> findByName(int start, int pageSize, String name) {
		return super.executeFinderPage("Topic.findByName", start, pageSize, name);
	}

	public List<Topic> findByExpireDttm(int start, int pageSize, String expireDttm) {
		return super.executeFinderPage("Topic.findByExpireDttm", start, pageSize, expireDttm);
	}

	public List<Topic> findByNameAndExpireDttm(int start,int pageSize,String name, String expireDttm) {
		return super.executeFinderPage("Topic.findByNameAndExpireDttm", start,pageSize,name, expireDttm);
	}

	public Topic getById(long id) {
		return super.read(id);
	}

	public void update(long id) {
		Topic topic = super.read(id);
		super.update(topic);
	}

	public void delete(long id)// 不是真是删除
	{
		Topic topic = super.read(id);
		super.delete(topic);
	}

}
